<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<script src="../js/jquery-1.7.2.min.js">
			
		</script>
	</head>


	<body>
		<header class="mui-bar mui-bar-nav ">
			<div class="mui-input-row mui-search" id="searchForm" >
				<input style="background-color: #fff" type="search" id="searchInput"  onkeyup="enterSearch(event)" class="mui-input-clear" placeholder="搜索你想要的" >
			</div>
		</header>
		<nav class="mui-bar mui-bar-tab " id="nav" >
			<a id="tab_home" class="mui-tab-item mui-active">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a id="tab_message" class="mui-tab-item">
				<span class="mui-icon mui-icon-email"></span>
				<span class="mui-tab-label">问题</span>
			</a>
			<!-- <a id="tab_contact" class="mui-tab-item">
				<span class="mui-icon mui-icon-contact"></span>
				<span class="mui-tab-label">回答</span>
			</a> -->
			<a id="tab_setting" class="mui-tab-item">
				<span class="mui-icon mui-icon-gear"></span>
				<span class="mui-tab-label">设置</span>
			</a>
		</nav>
		<script src="../js/mui.js"></script>
		
		<script type="text/javascript" charset="utf-8">
			mui.init({
				subpages: [ //首先加载首页  
					{
						url: 'home.html',
						id: 'tab_home',
						styles: {
							top: '55px',
							bottom: '60px'
						}
					}
				],
				preloadPages: [ //预加载其他页面  
					{
						url: 'question.html',
						id: 'tab_message',
						styles: {
							top: '0px',
							bottom: '60px'
						}
					},
					{
						url: 'answer.html',
						id: 'tab_contact',
						styles: {
							top: '0px',
							bottom: '60px'
						}
					},
					{
						url: 'setting.html',
						id: 'tab_setting',
						styles: {
							top: '0px',
							bottom: '60px'
						}
					}
				]
			});
			mui.plusReady(function() {
				//window.addEventListener('touchmove', func, { passive: false })
				plus.navigator.setStatusBarStyle("UIStatusBarStyleBlackOpaque");
				plus.navigator.setStatusBarBackground('#000000'); //设置状态栏的颜色	
				var tab_home, tab_message, tab_setting
				mui("#nav").on("tap", "#tab_home", function() { //点击触发   
					tab_home = plus.webview.getWebviewById("tab_home");
					tab_home.show()
					tab_message.hide();
//					tab_contact.hide();
					tab_setting.hide();
				})
				mui("#nav").on("tap", "#tab_message", function() { //点击触发  
					tab_message = plus.webview.getWebviewById("tab_message");
					tab_message.show()

				})
				mui("#nav").on("tap", "#tab_contact", function() { //点击触发  
					tab_contact = plus.webview.getWebviewById("tab_contact");
					tab_contact.show()

				})
				mui("#nav").on("tap", "#tab_setting", function() { //点击触发  
					tab_setting = plus.webview.getWebviewById("tab_setting");
					tab_setting.show()
				})
			})
			function enterSearch(event){
			    if(event.keyCode == 13) {//用户点击回车的事件号为13
			        var keyword = document.getElementById('searchInput').value;
			        window.localStorage.setItem("key", keyword);
					mui.openWindow({
			        	url: './select.html',
			        });
			    }
			}
		</script>

	</body>

</html>
